package com.company.math;

/**
 * @author jrue
 * @version 1.0
 * @date 2020/1/28 14:24
 */
public class ExcelSheetColumnNumber {

    public static void main(String[] args) {
        System.out.println(new ExcelSheetColumnNumber().titleToNumber(""));
    }
    public int titleToNumber(String s) {
        int res = 0;
        for (int i = 0; i < s.length(); i++) {
            int c = s.charAt(i) - 'A' + 1;
            res = res* 26 + c;
        }
        return res;
    }
}
